
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第 3 章 CM 安装部署 · 大数据 bigdata_cm_atguigu 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-solarizedlight.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="chapter1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    第 1 章 CM 概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    第 2 章 环境准备
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="di-3-zhang-cm-an-zhuang-bu-shu.html">
            
                <a href="di-3-zhang-cm-an-zhuang-bu-shu.html">
            
                    
                    第 3 章 CM 安装部署
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第 3 章 CM 安装部署</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B2C;-3-&#x7AE0;-cm-&#x5B89;&#x88C5;&#x90E8;&#x7F72;">&#x7B2C; 3 &#x7AE0; CM &#x5B89;&#x88C5;&#x90E8;&#x7F72;</h1>
<p>CM&#x4E0B;&#x8F7D;&#x5730;&#x5740;&#xFF1A;<a href="http://archive.cloudera.com/cm5/cm/5/" target="_blank">http://archive.cloudera.com/cm5/cm/5/</a>
&#x79BB;&#x7EBF;&#x5E93;&#x4E0B;&#x8F7D;&#x5730;&#x5740;&#xFF1A;<a href="http://archive.cloudera.com/cdh5/parcels" target="_blank">http://archive.cloudera.com/cdh5/parcels</a></p>
<h2 id="31-&#x89E3;&#x538B;cloudera-manager-el6-cm5121x8664targz">3.1 &#x89E3;&#x538B;<code>cloudera-manager-el6-cm5.12.1_x86_64.tar.gz</code></h2>
<pre class="language-"><code class="lang-bash"><span class="token function">mkdir</span> /opt/module/cloudera-manager
<span class="token function">tar</span> -zxvf /opt/software/cm/cloudera-manager-el6-cm5.12.1_x86_64.tar.gz -C /opt/module/cloudera-manager/
</code></pre>
<h2 id="32-&#x521B;&#x5EFA;&#x7528;&#x6237;&#x540D;cloudera-scm">3.2 &#x521B;&#x5EFA;&#x7528;&#x6237;&#x540D;:<code>cloudera-scm</code></h2>
<p>&#x5728;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x4E0A;&#x5206;&#x522B;&#x521B;&#x5EFA;&#x7528;&#x6237;&#x540D;:<code>cloudera-scm</code>, &#x5C06;&#x6765;&#x767B;&#x5F55; CM &#x7684;&#x65F6;&#x5019;&#x9ED8;&#x8BA4;&#x5C31;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x7528;&#x6237;&#x540D;.</p>
<pre class="language-"><code class="lang-bash"><span class="token function">useradd</span> --system --home<span class="token operator">=</span>/opt/module/cloudera-manager/cm-5.12.1/run/cloudera-scm-server --no-create-home --shell<span class="token operator">=</span>/bin/false --comment <span class="token string">&quot;Cloudera SCM User&quot;</span> cloudera-scm
</code></pre>
<blockquote>
<h4 id="&#x8BF4;&#x660E;"><em>&#x8BF4;&#x660E;:</em></h4>
</blockquote>
<ul>
<li><code>--system</code> &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7CFB;&#x7EDF;&#x8D26;&#x6237;</li>
<li><code>--home</code> &#x6307;&#x5B9A;&#x7528;&#x6237;&#x767B;&#x5165;&#x65F6;&#x7684;&#x4E3B;&#x76EE;&#x5F55;&#xFF0C;&#x66FF;&#x6362;&#x7CFB;&#x7EDF;&#x9ED8;&#x8BA4;&#x503C;/home/&lt;&#x7528;&#x6237;&#x540D;&gt;</li>
<li><code>--no-create-home</code> &#x4E0D;&#x8981;&#x521B;&#x5EFA;&#x7528;&#x6237;&#x7684;&#x4E3B;&#x76EE;&#x5F55;</li>
<li><code>--shell</code> &#x7528;&#x6237;&#x7684;&#x767B;&#x5F55; shell &#x540D;</li>
<li><code>--comment</code> &#x7528;&#x6237;&#x7684;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;</li>
</ul>
<h2 id="33-&#x914D;&#x7F6E;-cm-agent">3.3 &#x914D;&#x7F6E; CM Agent</h2>
<p>&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;:<code>&#x4FEE;&#x6539;&#x6587;&#x4EF6;/opt/module/cloudera-manager/cm-5.12.1/etc/cloudera-scm-agent/ config.ini</code></p>
<pre class="language-"><code class="lang-java">server_host<span class="token operator">=</span>hadoop201
</code></pre>
<h2 id="34-&#x914D;&#x7F6E;-cm-&#x7528;&#x5230;&#x7684;&#x6570;&#x636E;&#x5E93;">3.4 &#x914D;&#x7F6E; CM &#x7528;&#x5230;&#x7684;&#x6570;&#x636E;&#x5E93;</h2>
<ol>
<li>copy mysql &#x9A71;&#x52A8;&#x5230; <code>/usr/share/java</code> &#x76EE;&#x5F55;<pre class="language-"><code class="lang-bash"><span class="token function">mkdir</span> /usr/share/java
<span class="token function">cp</span> /opt/software/mysql-libs/mysql-connector-java-5.1.27/mysql-connector-java-5.1.27-bin.jar  /usr/share/java/
<span class="token function">mv</span> mysql-connector-java-5.1.27-bin.jar mysql-connector-java.jar
</code></pre>
</li>
<li><p>&#x5728; Mysql &#x4E2D;&#x521B;&#x5EFA; CM &#x5E93;</p>
<pre class="language-"><code class="lang-bash">/opt/module/cloudera-manager/cm-5.12.1/share/cmf/schema/scm_prepare_database.sh mysql cm -hhadoop201 -uroot -paaa --scm-host hadoop201 scm scm scm
</code></pre>
<blockquote>
<h4 id="&#x6CE8;&#x610F;"><em>&#x6CE8;&#x610F;:</em></h4>
</blockquote>
<ul>
<li>&#x5982;&#x679C;&#x6709;&#x5982;&#x4E0B;&#x5F02;&#x5E38;:
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552878733.png-atguiguText" alt="">
&#x5219;&#x9700;&#x8981;&#x5148;&#x5728; Mysql &#x4E2D;&#x7ED9;&#x7528;&#x6237; <code>scm</code> &#x8FDB;&#x884C;&#x6388;&#x6743;. &#x5728; Mysql &#x547D;&#x4EE4;&#x884C;&#x4E2D;&#x6267;&#x884C;&#x5982;&#x4E0B;&#x547D;&#x4EE4;:<pre class="language-"><code class="lang-bash">grant all privileges on *.* to <span class="token string">&apos;scm&apos;</span>@<span class="token string">&apos;%&apos;</span> identified by <span class="token string">&apos;scm&apos;</span> with grant option<span class="token punctuation">;</span>
</code></pre>
</li>
</ul>
</li>
</ol>
<h2 id="35-&#x5206;&#x53D1;&#x6574;&#x4E2A;-cloudera-manager-&#x76EE;&#x5F55;">3.5 &#x5206;&#x53D1;&#x6574;&#x4E2A; cloudera-manager &#x76EE;&#x5F55;</h2>
<h2 id="36-&#x521B;&#x5EFA;parcel-repo-&#x76EE;&#x5F55;">3.6 &#x521B;&#x5EFA;Parcel-repo &#x76EE;&#x5F55;</h2>
<p>&#x79BB;&#x7EBF;&#x4ED3;&#x5E93;&#x7684;&#x76EE;&#x5F55;.</p>
<ol>
<li><p>&#x5728; Server &#x8282;&#x70B9;(hadoop201) &#x521B;&#x5EFA;&#x76EE;&#x5F55;: <code>Parcel-repo</code></p>
<pre class="language-"><code class="lang-bash"><span class="token function">mkdir</span> -p /opt/cloudera/parcel-repo
<span class="token function">chown</span> cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
</code></pre>
</li>
<li><p>copy &#x6587;&#x4EF6;&#x5230; <code>/opt/cloudera/parcel-repo</code> &#x76EE;&#x5F55;&#x4E0B;</p>
<pre class="language-"><code class="lang-bash"><span class="token function">cp</span> /opt/software/cm/CDH* /opt/cloudera/parcel-repo/
<span class="token function">cp</span> /opt/software/cm/manifest.json /opt/cloudera/parcel-repo
<span class="token function">mv</span> /opt/cloudera/parcel-repo/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha1 /opt/cloudera/parcel-repo/CDH-5.12.1-1.cdh5.12.1.p0.3-el6.parcel.sha
</code></pre>
</li>
<li><p>&#x5728; Agent &#x8282;&#x70B9;&#xFF08;hadoop201&#xFF0C;hadoop202&#xFF0C;hadoop203&#xFF09;&#x521B;&#x5EFA;&#x76EE;&#x5F55;<code>/opt/cloudera/parcels</code></p>
<pre class="language-"><code class="lang-shell"><span class="token function">mkdir</span> -p /opt/cloudera/parcels
<span class="token function">chown</span> cloudera-scm:cloudera-scm /opt/cloudera/parcels
</code></pre>
</li>
<li><p>&#x5206;&#x53D1; <code>Parcel-repo</code>
&#x628A;&#x6574;&#x4E2A; <code>cloudera</code> &#x76EE;&#x5F55;&#x5206;&#x53D1;&#x5230;&#x5176;&#x4ED6;&#x8282;&#x70B9;</p>
</li>
</ol>
<h2 id="37-&#x542F;&#x52A8;cm-serveragent-&#x670D;&#x52A1;">3.7 &#x542F;&#x52A8;CM Server&amp;Agent &#x670D;&#x52A1;</h2>
<ol>
<li><p>&#x542F;&#x52A8; CM Server &#x670D;&#x52A1;</p>
<pre class="language-"><code class="lang-bash">/opt/module/cloudera-manager/cm-5.12.1/etc/init.d/cloudera-scm-server start
</code></pre>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552880416.png-atguiguText" alt=""></p>
</li>
<li><p>&#x542F;&#x52A8; Agent &#x670D;&#x52A1;
&#x5206;&#x522B;&#x5728;&#x6BCF;&#x4E2A; Agent &#x4E0A;&#x6267;&#x884C;&#x4E0B;&#x9762;&#x7684;&#x547D;&#x4EE4;&#x6765;&#x542F;&#x52A8; Agent</p>
<pre class="language-"><code class="lang-shell">/opt/module/cloudera-manager/cm-5.12.1/etc/init.d/cloudera-scm-agent start
</code></pre>
</li>
</ol>
<h2 id="38-&#x5173;&#x95ED;cm-serveragent-&#x670D;&#x52A1;">3.8 &#x5173;&#x95ED;CM Server&amp;Agent &#x670D;&#x52A1;</h2>
<pre class="language-"><code class="lang-bash">/opt/module/cloudera-manager/cm-5.12.1/etc/init.d/cloudera-scm-server stop
/opt/module/cloudera-manager/cm-5.12.1/etc/init.d/cloudera-scm-agent stop
</code></pre>
<h2 id="39-&#x4F7F;&#x7528;&#x6D4F;&#x89C8;&#x5668;&#x6253;&#x5F00;-httphadoop2017180">3.9 &#x4F7F;&#x7528;&#x6D4F;&#x89C8;&#x5668;&#x6253;&#x5F00; <a href="http://hadoop201:7180" target="_blank">http://hadoop201:7180</a></h2>
<p>&#x4F7F;&#x7528; chrome &#x6253;&#x5F00;&#x7684;&#x65F6;&#x5019;, &#x4E3A;&#x4E86;&#x80FD;&#x591F;&#x663E;&#x793A;&#x7684;&#x662F;&#x4E2D;&#x6587;, &#x53EF;&#x4EE5;&#x5148;&#x8BBE;&#x7F6E;&#x8BED;&#x8A00;&#x7684;&#x987A;&#x5E8F;:
<img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552889293.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892533.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892573.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892607.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892632.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892652.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892753.png-atguiguText" alt=""></p>
<h2 id="310-&#x5B89;&#x88C5;&#x670D;&#x52A1;">3.10 &#x5B89;&#x88C5;&#x670D;&#x52A1;</h2>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892783.png-atguiguText" alt=""></p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1552892833.png-atguiguText" alt=""></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-03-18 18:12:20
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="chapter1.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 第 2 章 环境准备">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第 3 章 CM 安装部署","level":"1.3","depth":1,"previous":{"title":"第 2 章 环境准备","level":"1.2","depth":1,"path":"chapter1.md","ref":"chapter1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"http://bigdataatguigu.applinzi.com/"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 bigdata_cm_atguigu 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"di-3-zhang-cm-an-zhuang-bu-shu.md","mtime":"2019-03-18T10:12:20.114Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-18T06:33:29.219Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

